package com.app.micaihu.view.army.adapter.messageprovider

import android.text.Html
import android.widget.ImageView
import android.widget.TextView
import com.app.micaihu.R
import com.app.micaihu.view.army.adapter.ArmyMessageListAdapter
import com.app.micaihu.view.bean.ArmyMessage
import com.app.micaihu.view.utils.loadCircleImage
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * 军团消息  成员提醒消息
 */
class MessageCenterItemProvider : BaseItemProvider<ArmyMessage>() {

    override val itemViewType: Int
        get() = ArmyMessageListAdapter.itemCenter

    override val layoutId: Int
        get() = R.layout.army_message_list_center_item

    override fun convert(helper: BaseViewHolder, item: ArmyMessage) {
        helper.getView<ImageView>(R.id.ivSysIcon).loadCircleImage(R.mipmap.icon)
        helper.setText(R.id.tvTime, item.datetime)
        helper.getView<TextView>(R.id.tvMessage).text = Html.fromHtml(item.msg)
    }

}